This is a test page.  It tests the three basic Kunaki API functions,  shipping options, order, and order_status.

These serve as excellect examples of how to place an order.  Order will call the shipping options method to get all possible shipping options, and then select the cheapest one.

For help, email me: joey.novak@gmail.com

Joey
<?php	
	require_once('kunaki/Kunaki.php');
	if(isset($_GET['shipping_options'])){
		$request = new ShippingRequest();
		$request->country = 'United States';
		$request->state = 'NY';
		$request->postalcode = '10004';
		$request->products = array(new KunakiProduct('XZZ1111111', 2));
		$response = Kunaki::getShippingOptions($request);
		var_dump($response->getShippingOptions());		
	}
	
	if(isset($_GET['order'])){
		$request = new ShippingRequest();
		$request->country = 'United States';
		$request->state = 'NY';
		$request->postalcode = '10004';
		$request->products = array(new KunakiProduct('XZZ1111111', 2));
		$response = Kunaki::getShippingOptions($request);
		
		$cheapestOption = $response->getCheapestOption();
		
		$request = new OrderRequest(true);
		$request->name = 'Joey Novak';
		$request->company = 'joeynovak.com';
		$request->address1 = '611 Kimball Pond Rd';
		$request->city = 'Aiken';
		$request->state = 'SC';
		$request->postalcode = '29803';
		$request->country = 'United States';
		$request->shipping_description = $cheapestOption['Description'];
		$request->products = array(new KunakiProduct('XZZ1111111', 2));
		$response = Kunaki::placeOrder($request);
		var_dump($response->getAllByTagName('Option'));		
	}
	
	if(isset($_GET['order_status'])){
		$request = new OrderRequest();
		$request->country = 'United States';
		$request->state = 'NY';
		$request->postalcode = '10004';
		$request->products = array(new KunakiProduct('XZZ1111111', 2));
		$response = Kunaki::getShippingOptions($request);
		var_dump($response);		
	}
?>

<form>
	<ul>
		<li><input type="submit" name="shipping_options" value="ShippingOptions"></li>
		<li><input type="submit" name="order" value="Order"></li>
		<li><input type="submit" name="order_status" value="OrderStatus"></li>
	</ul>
</form>
